package com.zhu.bitcom.config

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
import org.apache.ibatis.reflection.MetaObject
import org.springframework.stereotype.Component
import java.util.*

@Component
class MyMetaObjectHandler : MetaObjectHandler {
    override fun insertFill(metaObject: MetaObject?) {
        setFieldValByName("createTime", Date(),metaObject)
        setFieldValByName("updateTime", Date(),metaObject)
    }

    override fun updateFill(metaObject: MetaObject?) {
        setFieldValByName("updateTime",Date(),metaObject)
    }
}